package com.gigmissions.client.handlers;

import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.user.client.Window;
import com.google.inject.Inject;

public class MapWindowResizeHandler implements ResizeHandler {
	
	
	private MapWidget map;
	

	@Inject
	public MapWindowResizeHandler(MapWidget map){
		this.map = map;
		Window.addResizeHandler(this);
	}
	@Override
	public void onResize(ResizeEvent event) {
		//resize the map
		int newHeight = event.getHeight();
		int newWidth = event.getWidth();
		map.setSize(newWidth + "px",newHeight  + "px");
		map.checkResize();
		
				
	}

	

}
